/* UVa 11935 - Through the Desert
 * Simulation & Binary Search */
#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
/* Leak: -1
 * Gas: -2
 * Machanic: -3
 * Goal: -4
 */
struct evt {
  int m, t; // miles, type
};
vector<vector<evt> > event;
bool test(const double tank, vector<evt>&el) {
  int leak = 0, fc = 0, pos = 0;
  double gas = tank;
  for(auto&e:el) {
    double cover = e.m - pos;
    gas -= (cover/100)*fc + cover*leak;
    if(gas<eps)return false;
    pos = e.m;
    switch(e.t) {
      case -1:
        ++leak;
        break;
      case -2:
        gas = tank;
        break;
      case -3:
        leak = 0;
        break;
      case -4:
        return true;
      default:
        fc = e.t;
    }
  }
  return false;
}
void solve() {
  for(auto&el:event) {
    double l=0, r=1e9;
    double mid=(l+r)/2;
    while(r-l>eps) {
      mid = (l+r)/2;
      if(test(mid, el)) {
        r = mid;
      }
      else {
        l = mid;
      }
    }
    printf("%.3f\n", r);
  }
}
int main() {
  for(;;) {
    int fc, mil;
    string buf;
    cin>>mil>>buf>>buf>>fc;
    if(fc==0)break;
    event.push_back({});
    auto&e = event.back();
    e.push_back({mil, fc});
    for(;;) {
      cin>>mil>>buf;
      if(buf=="Fuel") {
        cin>>buf>>fc;
        e.push_back({mil, fc});
      }
      else if(buf=="Leak") {
        e.push_back({mil, -1});
      }
      else if(buf=="Gas") {
        cin>>buf;
        e.push_back({mil, -2});
      }
      else if(buf=="Mechanic") {
        e.push_back({mil, -3});
      }
      else if(buf=="Goal") {
        e.push_back({mil, -4});
        break;
      }
    }
  }

  solve();
  return 0;
}
